package com.zimmor.nacos;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:zimmor
 * @Date: 2021/5/5 20:46
 * @Description
 * @version: 1.0.0
 */
@SpringBootApplication
@RestController
@RefreshScope
public class NacosApplication {
    public static void main(String[] args) {
        SpringApplication.run(NacosApplication.class);
    }
    @Value("${common.name}")
    private String name;

    @GetMapping("/config1")
    public String getConfig1() {
        return name;
    }
}
